package com.example.administrator.testservice;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

public class MyService extends Service {
    public MyService() {
    }

    @Override
    public IBinder onBind(Intent intent) {
        // TODO: Return the communication channel to the service.
        throw new UnsupportedOperationException("Not yet implemented");
    }

    @Override
    public void onCreate() {
        super.onCreate();

        Log.i("jgh","onCreate.."+hashCode());
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.i("jgh","onDestroy.."+hashCode());
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        String name=intent.getStringExtra("name");
    Log.i("onStartCommand....name","onStartCommand....name...."+name);
        return super.onStartCommand(intent, flags, startId);
    }
}
